<ion-header>
  <ion-navbar>
    <ion-grid>
      <ion-row align-items-center>
        <ion-col col-10>{{content.title}}</ion-col>
        <ion-col col-2 class="warm_span">
          <button ion-button clear *ngIf="remind"
                  (tap)="remindTask(content.state,content.createuser,content.id)">催促</button>
        </ion-col>
      </ion-row>
    </ion-grid>


  </ion-navbar>
</ion-header>

<ion-content>

  <div class="detail_box">
    <i [class]="content.classname">{{content.state}}</i>
    <div>
      <label>创建人：</label>
      <span>{{content.createuser}}</span>
    </div>
    <div>
      <span>标题：</span>
      <span>{{content.title}}</span>
    </div>
    <div>
      <label>类型：</label>
      <span>{{content.type}}</span>
    </div>
    <div>
      <label>等级：</label>
      <span>{{content.level}}</span>
    </div>
    <div>
      <span>接收人：</span>
      <span>{{content.receiveuser}}</span>
    </div>
    <div>
      <label>所属项目：</label>
      <span>{{content.tasktype}}</span>
    </div>
    <div>
      <label>创建时间：</label>
      <span>{{content.createtime}}</span>
    </div>
    <div *ngIf="expectedtime">
      <label>预计完成时间：</label>
      <span>{{content.expectedtime}}</span>
    </div>
    <div *ngIf="state == 'complete_state'">
      <label>验收时间：</label>
      <span>{{content.checktime}}</span>
    </div>
    <div>
      <label>说明内容：</label>
      <span [innerHTML]="content.content"></span>
    </div>
    <div *ngIf="quality_score">
      <label>质量评分：</label>
      <span>{{quality_score}}</span>
    </div>
    <div *ngIf="efficiency_score">
      <label>效率评分：</label>
      <span>{{efficiency_score}}</span>
    </div>
  </div>

  <div class="handle_box">
    <!--未完成操作-->
    <div class="incomplete_box" *ngIf="state == 'incomplete_state' && receive_status == true">
      <ion-list radio-group class="incomplete_op" [(ngModel)]="incomplete_vaule">
        <h4>任务操作</h4>
        <ion-item>
          <ion-label>完成</ion-label>
          <ion-radio value="finish" checked="true" ></ion-radio>
        </ion-item>
        <ion-item>
          <ion-label>转让任务</ion-label>
          <ion-radio value="transfer"></ion-radio>
        </ion-item>
        <ion-item class="zhuanshou_box" style="font-size:1.2rem;" *ngIf="incomplete_vaule == 'transfer'">
          <ion-label>转让给：</ion-label>
          <ion-select [(ngModel)]="form_content.recipient">
            <ion-option value="{{item.id}}" *ngFor="let item of allcheckman">{{item.name}}</ion-option>
          </ion-select>
        </ion-item>
        <div *ngIf="incomplete_vaule == 'transfer'">
          <h5>说明</h5>
          <ion-item>
            <ion-textarea placeholder="请填写说明......" [(ngModel)]="form_content.instruction"></ion-textarea>
          </ion-item>
        </div>
      </ion-list>
      <!--<div class="submit_box" (tap)="taskOperation()">提交</div>-->
    </div>
    <!--待接收操作-->
    <div class="receive_box" *ngIf="state == 'receive_state' && receive_status == true" >
      <!--待接收成操作-->
      <ion-list radio-group class="receive_op" [(ngModel)]="incomplete_vaule">
        <h4>任务操作</h4>
        <ion-item>
          <ion-label>接受任务</ion-label>
          <ion-radio checked="true" value="catcher"></ion-radio>
        </ion-item>
        <ion-item *ngIf="incomplete_vaule == 'catcher'" class="timebox">
          <ion-label>预计完成时间</ion-label>
          <ion-datetime displayFormat="YYYY/MM/DD"
                        doneText="确定"
                        cancelText="取消"
                        [(ngModel)]="form_content.end_time"
                        [max]="dateMax"
                        [min]="dateMin">
          </ion-datetime>
        </ion-item>
        <ion-item>
          <ion-label>转让任务</ion-label>
          <ion-radio value="transfer"></ion-radio>
        </ion-item>
        <ion-item class="zhuanshou_box" style="font-size:1.2rem;" *ngIf="incomplete_vaule == 'transfer'">
          <ion-label>转让给：</ion-label>
          <ion-select [(ngModel)]="form_content.recipient">
            <ion-option value="{{item.id}}" *ngFor="let item of allcheckman">{{item.name}}</ion-option>
          </ion-select>
        </ion-item>
        <div *ngIf="incomplete_vaule == 'transfer'">
          <h5>说明</h5>
          <ion-item>
            <ion-textarea placeholder="请填写说明......" [(ngModel)]="form_content.instruction"></ion-textarea>
          </ion-item>
        </div>
      </ion-list>
    </div>
    <!--验收操作-->
    <div class="check_box" *ngIf="state == 'check_state' && check_status == true">
      <ion-list radio-group class="check_op" [(ngModel)]="incomplete_vaule">
        <h4>任务操作</h4>
        <ion-item>
          <ion-label>确认完成</ion-label>
          <ion-radio value="completion" checked="true"></ion-radio>
        </ion-item>
        <div class="taskscoring_box" *ngIf="incomplete_vaule == 'completion'">
          <h5 *ngIf="state == 'check_state'">任务评分</h5>
          <div class="score_box" *ngIf="state == 'check_state'">
            <span>完成效率：</span>
            <ion-icon *ngFor="let item of efficiency; let i = index"
                      (tap)="addscore(i)" name="md-star" [ngStyle]="{'color': i <= rate ? '#ffb200' : '#999999'}"
            ></ion-icon>
          </div>
          <div class="score_box" *ngIf="state == 'check_state'">
            <span>完成质量：</span>
            <ion-icon *ngFor="let item of efficiency; let i = index"
                      (tap)="addscore1(i)" name="md-star" [ngStyle]="{'color': i <= qualityrate ? '#ffb200' : '#999999'}"
            ></ion-icon>
          </div>
        </div>
        <ion-item>
          <ion-label>退回任务</ion-label>
          <ion-radio value="returner"></ion-radio>
        </ion-item>
        <div *ngIf="incomplete_vaule == 'returner'">
          <h5>说明</h5>
          <ion-item>
            <ion-textarea placeholder="请填写说明......" [(ngModel)]="form_content.instruction"></ion-textarea>
          </ion-item>
        </div>
      </ion-list>
    </div>
    <!--任务进展-->
    <h4 style="margin:10px;">任务进展</h4>
    <ion-list>
      <ion-grid class="tasklog" *ngFor="let item of tasklog">
        <ion-row align-items-center>
          <ion-col>
            <h5>{{item.log}}</h5>
            <p>{{item.note}}</p>
          </ion-col>
          <ion-col>{{item.time}}</ion-col>
        </ion-row>
      </ion-grid>
    </ion-list>
  </div>

</ion-content>

<ion-footer no-border *ngIf="content.state != 'complete_state' && showsubmit && showsubmit1" (tap)="taskOperation()">
  <ion-toolbar>
    <ion-title>提交</ion-title>
  </ion-toolbar>
</ion-footer>


